<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <ul>
        <!--v-for="变量 in 数组",循环遍历指令,遍历的过程中会生成当前元素以及子元素-->
        <li v-for="name in arr">{{name}}</li>
    </ul>
    <table border="1">
        <caption>员工列表</caption>
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>工资</th>
            <th>工作</th>
        </tr>
        <tr v-for="(emp,i) in empArr">
            <td>{{i+1}}</td>
            <td>{{emp.name}}</td>
            <td>{{emp.salary}}</td>
            <td>{{emp.job}}</td>
        </tr>

    </table>
</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el: "body>div",
        data: {
            info: "",
            arr: ["刘备", "关羽", "张飞"],
            empArr:[{name:"刘备",salary:3000,job:"销售"},
                {name:"关羽",salary:5000,job:"人事"},
                {name:"张飞",salary:13000,job:"程序员"}]
        }
    })
</script>
</body>
</html>